import request from '@/utils/request'

/**
 *获取所有部门负责人
 * @returns
 */
export function getEmployeesSimple() {
  return request({
    url: '/sys/user/simple',
    method: 'get'

  })
}
export function getEmployees(params) {
  return request({
    url: '/sys/user',
    method: 'get',
    params

  })
}
export function addEmployees(data) {
  return request({
    url: '/sys/user',
    method: 'POST',
    data

  })
}
export function delEmployee(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'

  })
}
export function addExcelEmployees(data) {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data

  })
}
export function getJobDetail(id) {
  return request({
    url: `/employees/${id}/jobs`,
    method: 'get'
  })
}
/**
 * @description: 为用户分配角色
 * @param {*} data { id:当前用户id, roleIds:选中的角色id组成的数组 }
 * @return {*}
 */
export function assignRoles(data) {
  return request({
    url: '/sys/user/assignRoles',
    data,
    method: 'put'
  })
}
